package com.htgraph.contour;

/**
 * Created by IntelliJ IDEA.
 * User: User
 * Date: 2010-7-10
 * Time: 15:08:36
 */
public class InterpGridgroup extends InterpConstantA {
    public InterpGridgroup(int xgrids, int ygrids) {
        super(xgrids, ygrids);
    }

    public void interpolate_next_final() {
        GridMergeAlg g = new GridMergeAlg(xgrids, ygrids, datanum, A);
        for (int num = 0; num < g.Gridgroupnum; num++) {
            for (int k = 0; k < dataLists.length; k++) {
//                    color.GridgroupStarti=g.getGridgroupValues().get(num).GridgroupStarti;
//                    color.GridgroupStartj=g.getGridgroupValues().get(num).GridgroupStartj;
//                    color.GridgroupEndi=g.getGridgroupValues().get(num).GridgroupEndi;
//                    color.GridgroupEndj=g.getGridgroupValues().get(num).GridgroupEndj;
//                    color.value= g.getGridgroupValues().get(num).alpha[k] * dataLists[k].z;
            }
        }
    }

    //@OverWrite
    public void interpolate_next() {
        GridMergeAlg g = new GridMergeAlg(xgrids,ygrids,datanum,A);
        for (int num = 0; num < g.Gridgroupnum; num++) {
            int starti = g.getGridgroupValues()[num].GridgroupStarti;
            int startj = g.getGridgroupValues()[num].GridgroupStartj;
            int endi = g.getGridgroupValues()[num].GridgroupEndi;
            int endj = g.getGridgroupValues()[num].GridgroupEndj;
            for (int i = starti; i <= endi; i++) {
                for (int j = startj; j <= endj; j++) {
                    for (int k = 0; k < dataLists.length; k++) {
                        interpLists[i][j].z += g.getGridgroupValues()[num].alpha[k] * dataLists[k].z;
                    }
                }
            }
        }
    }
}


